package frame.options.simulation.results.virtual.graphical;

import java.awt.Color;
import java.awt.Paint;

import model.components.nodes.node.Node;
import model.components.nodes.node.sdn.SdnNode;
import model.components.nodes.node.virtual.VirtualNode;

import org.apache.commons.collections15.Transformer;

public class VirtualNodeColorTransformer implements Transformer< Node, Paint >
{
	@Override
	public Paint transform( Node node )
	{
		SdnNode nodeSubstrate = ( (VirtualNode) node ).getSdnNode();
		
		if( node.isSelected() )
			return Color.GREEN;
		
		else if( !node.isSelected() && nodeSubstrate != null )
			return Color.YELLOW;
		
		return Color.BLACK;
	}

}
